<script setup lang='ts'>
import { useRoute, useRouter } from 'vue-router';

const route = useRoute()
// alert(JSON.stringify(route.query))
// alert(route.params.id)
const router = useRouter()//自定义hook的特性，必须在最顶层声明才可以使用
const back = () => {
       // router.back()
       router.go(-1)
}
</script>

<template>
       主页
       <button @click="back()">返回</button>
</template>

<style scoped></style>